﻿using System;

using System.Data;
using Model;


public partial class ListActionTaken : System.Web.UI.Page
{
    private DirectServiceActionTaken _DirectServiceActionTaken = new DirectServiceActionTaken();
   
    protected void Page_Load(object sender, EventArgs e)
    { 
       
        string whereClause = ValueUseOtherPage.queryActionTakenToListActionTanken;
        txtHiddenWhereClause.Text = whereClause;
        DataTable tbActionTaken = new DataTable(); 
        tbActionTaken = _DirectServiceActionTaken.GetActionTakenDiplayed(whereClause, null);
        if(tbActionTaken.Rows.Count!=0)
        {
            lblTotalActionTaken.Text = "Total Action taken:" + tbActionTaken.Rows.Count.ToString();
            grdListActionTaken1.Visible = false;
            grdListActionTaken.Visible = true; 
        }
        else {
            grdListActionTaken1.Visible = true;
            grdListActionTaken.Visible = false; 
        }

        // lblTotalActionTaken.Text = "Total Action taken :" +
         //                          _DirectServiceActionTaken.GetActionTakenDiplayed(whereClause, null).Rows.Count;
       
    }
    public int GetPageIndex()
    {
        return Session["pageIndex"] != null
                   ?
                       Int32.Parse(Session["pageIndex"].ToString())
                   : 0;
    }
    public int GetTabIndex()
    {
        int tabIndex = Request.QueryString["tabIndex"] != null
                        ?
                            Int32.Parse(Request.QueryString["tabIndex"])
                        : 0;
        if (Session["defaultTabIndex"] != null)
        {
            tabIndex = Int32.Parse(Session["defaultTabIndex"].ToString());
            Session["defaultTabIndex"] = null;
        }

        return tabIndex;
    }
    
}
